﻿using System;
using System.Collections.Generic;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository.Comparers.EntityModelsComparers
{
    public class SecuriryClassComparer : IEqualityComparer<SecurityClass>
    {
        public bool Equals(SecurityClass x, SecurityClass y)
        {
            return x.Name.Equals(y.Name, StringComparison.InvariantCultureIgnoreCase);
        }

        public int GetHashCode(SecurityClass obj)
        {
            return obj.Name == null ? 0 : obj.Name.ToUpper().GetHashCode();
        }
    }
}